package com.yun.csv2db.service.impl;

import com.yun.csv2db.entity.Student;
import com.yun.csv2db.repository.StudentRepository;
import com.yun.csv2db.service.StudentService;
import org.springframework.stereotype.Service;

@Service
public class StudentServiceImpl implements StudentService {

    private StudentRepository studentRepository;

    @Override
    public void save(Student student) {
        studentRepository.save(student);
    }

    @Override
    public Student findById(int id) {
        return studentRepository.findById(id);
    }

    @Override
    public Student findByName(String name) {
        return studentRepository.findByName(name);
    }
}
